# 随机生成50-100个姓名（每个名字5个英文字母，首字母大写）具体需求：
# 【1】输入生成的所有姓名，每行10个
# 【2】输出7的倍数或者包含7的索引位上的名字。
# 【3】获取所有的H开头的所有姓名
# 【4】删除所有带4的索引号的姓名
# 【5】把首字母为A的改成B

import random
import string


name_list = []
for i in range(random.randint(50,100)):
    temp_name = "".join(random.sample(string.ascii_lowercase,5))
    name_list.append(temp_name.title())


for i in range(0,random.randint(50,100),10):
    print(name_list[i:i+10])

print("============================================")

try:
    for i in range(6,random.randint(50,100),7):
        print(name_list[i])
    for j in range(16,random.randint(50,100),10):
        print(name_list[j])
except:
    pass

print("============================================")

for each in name_list:
    if each.startswith("H"):
        print(each)

print("============================================")
try:
    step = 9
    for m in range(3,random.randint(50,100),step):
        print(name_list.pop(m))
        step -= 1
except:
    pass
print("============================================")
for each in name_list:
    if each.startswith("A"):
        print(each.replace("A","B"))